package com.yxx.annotation;

import com.yxx.validator.EnumValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * 自定义评论类型注解
 * @author yuxiangxun
 * @date 2025/2/9
 * @apiNote
 */
@Documented
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = {EnumValidator.class}) // 指定校验器
public @interface EnumValid {
    String message() default "{javax.validation.constraints.NotBlank.message}";
    Class<?>[] groups() default { };
    Class<? extends Payload>[] payload() default { };

    /**
     * @return 评论类型
     */
    int[] values() default {};

}
